import request from '@/utils/request';
// @ts-ignore
import {MALL_PATH_WEB_PREFIX} from '@/types/store/prefix.d.ts';

/**
 * 获取商品属性列表
 *
 * @param params
 */
export function listAttributes(id: string, type: string) {
  return request({
    url: MALL_PATH_WEB_PREFIX + '/category' + id + '/attribute/list',
    method: 'get',
    params: type,
  });
}

/**
 * 批量修改商品属性
 *
 * @param data
 */
export function saveAttributeBatch(id: string, data: object) {
  return request({
    url: MALL_PATH_WEB_PREFIX + '/category' + id + '/attribute/list',
    method: 'put',
    data: data,
  });
}
